<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>鼠标移出移入</title>
	</head>
	<body>
		<div id="box">Hello JQuery</div>
		<script src="jquery-1.12.4.min.js"></script>
		<script>
			/*原生js实现*/
			/*var div=document.getElementById('box');
			div.onmouseover=function(){
				div.style.background='green';
			};
			div.onmouseout=function(){
				div.style.background='white';
			};*/
			/*jquery实现*/
			$('#box').mouseover(
				function(){
					$('#box').css('background','greenyellow');
					console.log("123");
				}
			);
			$('div').mouseout(
				function(){
					$('div').css('background','red');
					console.log("afr");
				}
			);
			
			//同时绑定多个事件
			$('div').on(
				{
					mouseover:function(){
						$('div').css('background','red');
					},
					mouseover:function(){
						$('div').css('background','yellow');
					},
					click:function(){
						$('div').css('background','black');
					}
				}
			);
		</script>
	</body>
</html>
